package com.yc.cloud.common.basic.api;

/**
 * @Description: 返回结果封装类
 * @Author JackGu
 * @Date: 2022/6/7 18:03
 * @Version 1.0
 */
public enum ResponseStatus implements IErrorCode {

    /***
     * description: 状态码封装
     *
     */
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    VALIDATE_FAILED(400, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),
    NOT_FOUND(404, "找不到相关资源");

    private final long code;
    private final String message;

    ResponseStatus(long code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public long getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
